clear all
close all

[fname,fpath]=uigetfile('*.*','select the file to load'); %%% Get node data
VZDL=double(dlmread(strcat(fpath,fname),','));

[L,W]=size(VZDL);
dateTime=VZDL(:,1);
tag=VZDL(:,2);
site=VZDL(:,3);
capHist=zeros(1,5);
etime=diff(dateTime);

ind=find(etime>.08); % 0.08 = 2hours elapsed time to trigger "new" detection

if isempty(ind)
    capHist=calculateCH(capHist,VZDL,1,L);
else
    lower=1;
    for i=1:length(ind)
        capHist=calculateCH(capHist,VZDL,lower,ind(i));
        lower=ind(i)+1;
    end;
    
    capHist=calculateCH(capHist,VZDL,lower,L);
end;
capHist(1,:)=[]
       
